#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pydantic import BaseModel, Field
from typing import List

class FragmentRequest(BaseModel):
    query: str = Field(..., example="新能源发展", description="用户问题")
    texts: List[str] = Field(..., min_items=1, example=["text1", "text2"], description="待排序文本列表")

    class Config:
        schema_extra = {
            "example": {
                "query": "新能源发展",
                "texts": ["文本1", "文本2"],
            }
        }

class RerankerResponse(BaseModel):
    score: float = Field(..., example=0.85, description="排序得分")
    sorted_texts: List[str] = Field(..., description="排序后的文本列表")
